<?php session_start(); # wichtig: zu aller erst

# Konvention: Variablenname == Schluessel
$_SESSION['gleiche'] = isset ($_SESSION['gleiche']) ? $_SESSION['gleiche'] : 0;

if (isset($_GET['sstat']))
{
	echo $_SESSION['gleiche']."<br />\n";
	echo "<a href='{$_SERVER['PHP_SELF']}'>zur&uuml;ck</a>";
}
else 
{
	?>
	<form action="a04_strcmp_B.php?<?php echo SID?>" method="get" >
		<input type="text" name="i1" />
		<input type="text" name="i2" />
		<input type="submit" name="sstat" value="stat" />
		<input type="submit" name="stest" value="test" />
		<input type="submit" name="sneu" value="neu" />		
	</form>
	<?php 
	if (isset ($_GET['stest']) and !empty($_GET['i1']) and !empty($_GET['i2']))
	{
		if (strcmp($_GET['i1'], $_GET['i2']) == 0)
		{
			$_SESSION['gleiche']++;
		}
	}
	elseif (isset ($_GET['sneu']))
	{
		# Session zerstoeren, lieber doppelgemoppelt
		session_destroy();
		$_SESSION = array();
	}
			
}
?>